<?php
if(!check_manager_login()) exit('无权查看，请登录!');
require_once MODEL_PATH.DS.'Album.php';
$Album = new Album();

if(check_post()){
	$album_id= $_POST['album_id'];
	$name = trim($_POST['name']);
	if(empty($name)) redirect('index.php?mod=album&act=list','名称不能为空！');

	$result = $Album->editAlbum($album_id,$name,trim($_POST['desc']));
	if($result){
		redirect('index.php?mod=album&act=list','编辑相册成功！');
	}
}
$album_id = isset($_GET['album_id'])?(int)$_GET['album_id']:'';
$album = $Album->getAlbumById($album_id);
include load_tpl('album_add');
?>